#include "scripts\products.iss"

#include "scripts\products\winversion.iss"
#include "scripts\products\fileversion.iss"

//#include "scripts\products\iis.iss"

#include "scripts\products\kb835732.iss"
//#include "scripts\products\kb886903.iss"
//#include "scripts\products\kb928366.iss"

#include "scripts\products\msi20.iss"
#include "scripts\products\msi31.iss"
#include "scripts\products\ie6.iss"

//#include "scripts\products\dotnetfx11.iss"
//#include "scripts\products\dotnetfx11lp.iss"
//#include "scripts\products\dotnetfx11sp1.iss"

#include "scripts\products\dotnetfx20.iss"
#include "scripts\products\dotnetfx20lp.iss"
#include "scripts\products\dotnetfx20sp1.iss"
#include "scripts\products\dotnetfx20sp1lp.iss"
#include "scripts\products\dotnetfx20sp2.iss"
#include "scripts\products\dotnetfx20sp2lp.iss"

#include "scripts\products\dotnetfx35.iss"
//#include "scripts\products\dotnetfx35lp.iss"
//#include "scripts\products\dotnetfx35sp1.iss"
//#include "scripts\products\dotnetfx35sp1lp.iss"

//#include "scripts\products\mdac28.iss"
//#include "scripts\products\jet4sp8.iss"
//#include "scripts\products\sql2005express.iss"

[CustomMessages]
win2000sp3_title=Windows 2000 Service Pack 3
winxpsp2_title=Windows XP Service Pack 2

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{6C97AA5A-F48B-4AEF-B1CF-D6587AE4079B}
AppName=Meta
AppVerName=Meta 0.4
AppPublisher=Meta Community
AppPublisherURL=http://code.google.com/p/metalang/
AppSupportURL=http://code.google.com/p/metalang/
AppUpdatesURL=http://code.google.com/p/metalang/
DefaultDirName={pf}\Meta 0.4
DefaultGroupName=Meta 0.4
OutputDir=Releases
OutputBaseFilename=Meta 0.4 Setup
Compression=lzma
SolidCompression=yes
ChangesAssociations=yes
SetupIconFile=Icons\Meta.ico
AllowNoIcons=yes

[Languages]
Name: "en"; MessagesFile: "compiler:Default.isl"
Name: "de"; MessagesFile: "compiler:Languages\German.isl"

[Files]
Source: "bin\Debug\Meta.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "bin\Debug\Oyster.IntX.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Meta\bin\Debug\Meta.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Metaphore\bin\Debug\Meta Edit.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Metaphore\bin\Debug\ICSharpCode.AvalonEdit.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Metaphore\bin\Debug\meta.xshd"; DestDir: "{app}"; Flags: ignoreversion
Source: "Icons\MetaFile.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "Test\Basic\check.txt"; DestDir: "{app}\Test\Basic"; Flags: ignoreversion
Source: "Test\Library\check.txt"; DestDir: "{app}\Test\Library"; Flags: ignoreversion
Source: "Test\Serialization\check.txt"; DestDir: "{app}\Test\Serialization"; Flags: ignoreversion
Source: "Test\Documentation\check.txt"; DestDir: "{app}\Test\Documentation"; Flags: ignoreversion
;Source: "Test\Performance\check.txt"; DestDir: "{app}\Test\Performance"; Flags: ignoreversion
Source: "Test\basicTest.meta"; DestDir: "{app}\Test"; Flags: ignoreversion
Source: "Test\libraryTest.meta"; DestDir: "{app}\Test"; Flags: ignoreversion
Source: "Test\performanceTest.meta"; DestDir: "{app}\Test"; Flags: ignoreversion
Source: "library.meta"; DestDir:"{app}\"; Flags: ignoreversion
Source: "documentation.meta"; DestDir:"{app}\"; Flags: ignoreversion
;Source: "Library\*.meta"; DestDir:"{app}\Library"; Flags:recursesubdirs
;Source: "Dependencies\vjredist.exe"; DestDir: "{tmp}"


[Icons]
Name: "{userprograms}\Hyper"; Filename: "{app}\Hyper.exe"


[Registry]
Root: HKCR; Subkey: ".meta"; ValueType: string; ValueName: ""; ValueData: "MetaFile"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "MetaFile"; ValueType: string; ValueName: ""; ValueData: "Meta File"; Flags: uninsdeletekey
Root: HKCR; Subkey: "MetaFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\MetaFile.ico"
Root: HKCR; Subkey: "MetaFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\Meta.EXE"" ""%1"""
Root: HKCR; Subkey: "MetaFile\shell\Edit with Meta Edit"; ValueType: string; ValueName: ""; ValueData: "Edit with Meta Edit"
Root: HKCR; Subkey: "MetaFile\shell\Edit with Meta Edit\command"; ValueType: string; ValueName: ""; ValueData: """{app}\Meta Edit.EXE"" ""%1"""
;Root: HKCR; Subkey: "meta"; ValueType: string; ValueName: ""; ValueData: "URL: Meta Protocol"; Flags: uninsdeletevalue
;Root: HKCR; Subkey: "meta"; ValueType: string; ValueName: "URL Protocol"; ValueData: ""; Flags: uninsdeletevalue
;Root: HKCR; Subkey: "meta\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "Meta.exe"; Flags: uninsdeletevalue
;Root: HKCR; Subkey: "meta\shell\open\command"; ValueType: string; ValueName: ""; ValueData: "{app}\Meta.exe %1"; Flags: uninsdeletevalue

;[Run]
;Filename: "{tmp}\vjredist.exe";

[Code]
function InitializeSetup(): Boolean;
begin
	//init windows version
	initwinversion();
	
	//check if dotnetfx20 can be installed on this OS
	//if not minwinspversion(5, 0, 3) then begin
	//	MsgBox(FmtMessage(CustomMessage('depinstall_missing'), [CustomMessage('win2000sp3_title')]), mbError, MB_OK);
	//	exit;
	//end;
	//if not minwinspversion(5, 1, 2) then begin
	//	MsgBox(FmtMessage(CustomMessage('depinstall_missing'), [CustomMessage('winxpsp2_title')]), mbError, MB_OK);
	//	exit;
	//end;
	
	//if (not iis()) then exit;
	
	//msi20('2.0');
	//msi31('3.0');
	//ie6('5.0.2919');
	
	//dotnetfx11();
	//dotnetfx11lp();
	//dotnetfx11sp1();
	//kb886903(); //better use windows update
	//kb928366(); //better use windows update
	
	//install .netfx 2.0 sp2 if possible; if not sp1 if possible; if not .netfx 2.0
	//if minwinversion(5, 1) then begin
	//	dotnetfx20sp2();
	//	dotnetfx20sp2lp();
	//end else begin
	//	if minwinversion(5, 0) and minwinspversion(5, 0, 4) then begin
	//		kb835732();
	//		dotnetfx20sp1();
	//		dotnetfx20sp1lp();
	//	end else begin
	//		dotnetfx20();
	//		dotnetfx20lp();
	//	end;
	//end;
	
	//dotnetfx35();
	//dotnetfx35lp();
	//dotnetfx35sp1();
	//dotnetfx35sp1lp();
	
	//mdac28('2.7');
	//jet4sp8('4.0.8015');
	//sql2005express();
	
	Result := true;
end;
